Minitest
In the steps below, we'll start with a Ruby project that has an existing minitest test suite, and we'll add JUnit XML as an additional output format for the test suite. In each step, we'll show the Git diff for the change that we're making.
Add
minitest-ci
as a dependency.bundle add minitest-ci
Verify that your
Gemfile
file includes the new dependency:ruby '2.7.4'
gem 'minitest'
+gem 'minitest-ci'
gem 'rake'Require
minitest/ci
in your tests. Find where you're currently requiringminitest
(such astest/test_helper.rb
in the example below) and update it to requireminitest/ci
as well.require 'minitest/autorun'
+require 'minitest/ci'minitest-ci
writes the JUnit reports to atest/reports
directory at the root of your project. Update your.gitignore
file so that the reports don't get accidentally checked into the repository./.bundle
+/test/reportsCommit these changes to your repository.
git commit -am "Generate JUnit XML test reports with minitest-ci"
The final result of these changes should resemble commit ff08dc8 in the buildpulse-example-ruby-minitest repository.